package comday08.itheima01;

import java.util.Scanner;

public class Demo05 {
    public static void main(String[] args) {

        //只要不是直接写 "",那么字符串对象就会创建在堆内存，不能放在常量池
        String s1 = "ab";

        String s2 = "ab" + "c";  //常量池

        String s3 = s1 + "c";    //堆内存


        System.out.println(s2 == s3);    //false


        Scanner sc = new Scanner(System.in);
        System.out.println("键盘输入密码：");
        String mm = sc.next();
        System.out.println("键盘输入确认密码：");
        String mm2 = sc.next();

        System.out.println(mm.equals(mm2));

    }
}
